Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove incorrect assumption that GitHub Actions supports native label filtering for issues - Change issues events to use 'names' field (same as pull_request and discussion) - Update label trigger parser to use job condition filtering for all event types - Update tests to reflect new behavior - Recompile all workflow files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Update FuzzExpandLabelTriggerShorthand to expect names field for all event types including discussion, matching the corrected behavior where all events use job condition filtering Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…-f009-4b18-a194-995ebbcb3d75
There was a problem hiding this comment.
Pull request overview
This PR fixes a schema validation failure in label trigger shorthand expansion by correcting the implementation to use the internal names field for job condition filtering instead of attempting to use GitHub Actions' native label filtering (which doesn't exist for any event type).
Changes:
- Removed incorrect use of native GitHub Actions
labelsfield and__gh_aw_native_label_filter__marker for issues events - Updated
expandLabelTriggerShorthandto usenamesfield consistently for all event types (issues, pull_request, discussion) - Updated all tests (unit, fuzz, and integration) to reflect the corrected behavior
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/workflow/label_trigger_parser.go | Core fix: Simplified label trigger expansion to use names field for all event types, removing special case for issues events and the native filter marker |
| pkg/workflow/label_trigger_parser_test.go | Updated unit tests to expect names field for all entity types instead of conditional labels/names based on event type |
| pkg/workflow/label_trigger_parser_fuzz_test.go | Fixed fuzz test to correctly expect names field for all event types including discussion |
| pkg/workflow/label_trigger_integration_test.go | Updated integration test to verify the native filter marker is NOT present in expanded triggers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // All event types use `names` field for job condition filtering | ||
| // The `names` field is an internal representation for job condition generation | ||
| // and won't be rendered in the final GitHub Actions YAML for these event types | ||
| triggerConfig["names"] = labelNames |
There was a problem hiding this comment.
The code now adds the names field to all event types including discussion, but the schema definition for the discussion event in pkg/parser/schemas/main_workflow_schema.json (lines 617-630) does not include a names property and has "additionalProperties": false. This will cause schema validation to fail when compiling workflows with discussion label triggers like "discussion labeled question".
The schema needs to be updated to add a names field definition to the discussion event properties, similar to how it's defined for issues (lines 573-590) and pull_request (lines 482-499) events.
Fix label trigger shorthand schema validation
Problem Analysis
TestTriggerShorthandBackwardCompatibility/label_trigger_shorthandlabelsfield inissuestriggerlabel_trigger_parser.go)compiler_orchestrator_frontmatter.go)main_workflow_schema.json)Root Cause
The
expandLabelTriggerShorthandfunction added alabelsfield to theissuestrigger configuration for native GitHub Actions label filtering. However:types,names, andlock-for-agentproperties forissueseventslabelsfieldSolution Implemented
expandLabelTriggerShorthandto usenamesfield for all event typesissuesthat addedlabelsand__gh_aw_native_label_filter__markernamesfield for all entity typesTesting
TestTriggerShorthandBackwardCompatibility- now passes ✅TestExpandLabelTriggerShorthand- updated and passes ✅TestLabelTriggerIntegration*- all pass ✅FuzzExpandLabelTriggerShorthand- fixed and passes ✅Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.